<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 

$arrTel = explode("-", $member[mb_tel]);
$mb_tel_1 = $arrTel[0];
$mb_tel_2 = $arrTel[1];
$mb_tel_3 = $arrTel[2];

$arrEmail = explode("@", $member[mb_email]);
$mb_email_1 = $arrEmail[0];
$mb_email_2 = $arrEmail[1];

$cnt = 1;
if($member[mb_addr3_1] != "") $cnt = 3;
if($member[mb_addr2_1] != "") $cnt = 2;
?>


<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/base/jquery-ui.css" rel="stylesheet" />
<link href="../css/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script>
<script>
var member_skin_path = "<?=$member_skin_path?>";

var flen = "<?=$cnt?>";;
function addDirectAddr()
{
    if (flen > 2)
    {
        alert("직거래 가능지역은 "+flen+"개 까지만 등록이 가능합니다.");
        return;
    }

    if (flen == 1)
    {
        document.getElementById("jik2_1").style.display = "";
        //document.getElementById("jik2_2").style.display = "";
    }

    if (flen == 2)
    {
    	document.getElementById("jik3_1").style.display = "";
        //document.getElementById("jik3_2").style.display = "";
    }

    flen++;
}

function delDirectAddr()
{

    if (flen <= 1)
    {
        alert("더이상 삭제할 수 없습니다.");
        return;
    }

    if (flen == 2)
    {
        document.getElementById("jik2_1").style.display = "none";
        //document.getElementById("jik2_2").style.display = "";
    }

    if (flen == 3)
    {
    	document.getElementById("jik3_1").style.display = "none";
        //document.getElementById("jik3_2").style.display = "";
    }

    flen--;
}

function addressChk(chk){
	if (chk.checked)
	{
		document.getElementById("mb_addr1_1").value = document.getElementById("mb_addr1").value;
		//document.getElementById("mb_addr1_2").value = document.getElementById("mb_addr2").value;
	}
	else
	{
		document.getElementById("mb_addr1_1").value = "";
		//document.getElementById("mb_addr1_2").value = "";
	}
}
</script>
<script type="text/javascript" src="<?=$member_skin_path?>/ajax_register_form.jquery.js"></script>
<script type="text/javascript" src="<?=$g4[path]?>/js/md5.js"></script>
<script type="text/javascript" src="<?=$g4[path]?>/js/sideview.js"></script>

<form id="fregisterform" name=fregisterform method=post onsubmit="return fregisterform_submit(this);" enctype="multipart/form-data" autocomplete="off">
<input type=hidden name=w                value="<?=$w?>">
<input type=hidden name=url              value="<?=$urlencode?>">
<input type=hidden name=mb_jumin         value="<?=$jumin?>">
<input type=hidden name=mb_id_enabled    value="" id="mb_id_enabled">
<input type=hidden name=mb_nick_enabled  value="" id="mb_nick_enabled">
<input type=hidden name=mb_email_enabled value="" id="mb_email_enabled">
<input type=hidden name=mb_password_enabled value="" id="mb_password_enabled">
<input type=hidden name=mb_id  id=mb_id  value="<?=$member[mb_id]?>">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"><table width="860" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="17">&nbsp;</td>
      </tr>
      <tr>
        <td align="right"><a href="#"><img src="../img/comm/smenu01.gif" alt="" width="29" height="12" border="0" /></a><img src="../img/comm/smenu_line.gif" width="2" height="12" hspace="7" /><a href="#"><img src="../img/comm/smenu_join.gif" width="38" height="12" border="0" /></a></td>
      </tr>
      <tr>
        <td height="22">&nbsp;</td>
      </tr>
      <tr>
        <td height="115" align="center" valign="top"><a href="#"><img src="../img/comm/logo.gif" width="302" height="71" border="0" /></a></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="145" align="center" background="../img/comm/search_bg.gif"><table width="300" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td align="center"><a href="javascript:history.back();"><img src="../img/seoul/step02.gif" width="106" height="100" border="0" /></a></td>
                <td align="right"><img src="../img/seoul/step04_on.gif" width="106" height="100" /></td>
              </tr>
            </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="188" align="center" valign="top"><table width="644" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="106" colspan="3">&nbsp;</td>
        </tr>
        <tr> 
          <td width="216" height="50" align="right"><img src="../img/seoul/stitle03.gif" width="95" height="17" /></td>
          <td width="26">&nbsp;</td>
          <td width="402" align="left"><input name="mb_real_password" type="password" class="box2" id="mb_real_password" /></td>
        </tr>
        <tr> 
          <td height="50" align="right"><img src="../img/seoul/stitle04.gif" width="79" height="17" /></td>
          <td>&nbsp;</td>
          <td align="left"><input name="mb_password" type="password" class="box2" id="mb_password" /></td>
        </tr>
        <tr> 
          <td height="50" align="right"><img src="../img/seoul/stitle05.gif" width="115" height="17" /></td>
          <td>&nbsp;</td>
          <td align="left"><input name="mb_password_re" type="password" class="box2" id="mb_password_re" /></td>
        </tr>
        <tr> 
          <td height="80" colspan="3" align="center">
          	<input type=image src="../img/seoul/bt01.gif" width="91" height="44" />
          </td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td align="center">&nbsp;</td>
  </tr>
</table>
</form>


<script type="text/javascript" src="<?="$g4[path]/js/jquery.kcaptcha.js"?>"></script>
<script type="text/javascript">
//submit 최종 폼체크
function fregisterform_submit(f) 
{
    // 회원아이디 검사
    if (f.w.value == "") {

        reg_mb_id_check();

        if (document.getElementById('mb_id_enabled').value!='000') {
            alert('회원아이디를 입력하지 않았거나 입력에 오류가 있습니다.');
            document.getElementById('reg_mb_id').select();
            return false;
        }
    }

    if (f.mb_real_password.value.length < 1) {
        alert('현재비밀번호를 입력하십시오.');
        f.mb_real_password.focus();
        return false;
    }

    reg_mb_password_check();
    if ($("#mb_password_enabled").val() != '000'){
    	f.mb_real_password.focus();
        return false;
    }
    if (f.mb_password.value.length < 3) {
        alert('패스워드를 3글자 이상 입력하십시오.');
        f.mb_password.focus();
        return false;
    }

    if (f.mb_password.value != f.mb_password_re.value) {
        alert('패스워드가 같지 않습니다.');
        f.mb_password_re.focus();
        return false;
    }

    if (f.mb_password.value.length > 0) {
        if (f.mb_password_re.value.length < 3) {
            alert('패스워드를 3글자 이상 입력하십시오.');
            f.mb_password_re.focus();
            return false;
        }
    }

    <?
    if ($g4[https_url])
        echo "f.action = '$g4[https_url]/$g4[bbs]/register_form_password_update.php';";
    else
        echo "f.action = './register_form_password_update.php';";
    ?>

    // 보안인증관련 코드로 반드시 포함되어야 합니다.
    set_cookie("<?=md5($token)?>", "<?=base64_encode($token)?>", 1, "<?=$g4['cookie_domain']?>");

    return true;
}


</script>
